package com.whfc.fmam.map;

import com.whfc.fmam.entity.bo.FmamMatUnit;
import com.whfc.fmam.entity.bo.FmamUnit;
import com.whfc.fmam.entity.dto.FmamMatUnitDTO;
import com.whfc.fmam.entity.dto.SyncFmamUnitDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

/**
 * @Description:
 * @author: xugcheng
 * @version: 1.0
 * @date: 2019/10/17 10:07
 */
@Mapper(componentModel = "spring")
public interface UnitMap {

    @Mappings({
            @Mapping(source = "id", target = "unitId"),
            @Mapping(source = "code", target = "unitCode"),
            @Mapping(source = "name", target = "unitName")
    })
    SyncFmamUnitDTO to(FmamUnit unit);

    FmamMatUnit to(FmamMatUnitDTO record);
}
